import React from 'react';
import { TabBar } from "antd-mobile"
import { withRouter } from "react-router-dom"

class MyTab extends React.Component {
	constructor(props) {
		super(props);
		this.state = {
			selectedTab: '/bushome',
		};
	}
	render() {
		const { pathname } = this.props.location;
		return (
			<div style={{ position: 'fixed', width: '100%', bottom: 0 }}>
				<TabBar
					unselectedTintColor="#ccc"
					tintColor="#ccc"
					barTintColor="rgb(47,49,67)"
				>
					<TabBar.Item
						icon={
							<i className='iconfont icon-paperplane'></i>
						}
						selectedIcon={
							<i className="iconfont icon-fabu"></i>
						}
						title="我的发布"
						key="home"
						selected={pathname === '/bushome'}
						onPress={() => {
							this.props.history.push('/bushome')
						}}
						data-seed="logId1"
					>
					</TabBar.Item>

					<TabBar.Item
						icon={
							<i className="iconfont icon-pingjia"></i>
						}
						selectedIcon={
							<i className="iconfont icon-ico_home_appraise"></i>
						}
						title="我的评价"
						key="comment"
						selected={pathname === '/comment'}
						onPress={() => {
							this.props.history.push('/comment')
						}}
						data-seed="logId1"
					>
					</TabBar.Item>

					<TabBar.Item
						icon={
							<i className='iconfont icon-xiaoxi1'></i>
						}
						selectedIcon={
							<i className="iconfont icon-xiaoxi"></i>
						}
						title="消息"
						key="orderlist"
						selected={pathname === '/privatechat'}
						onPress={() => {
							this.props.history.push('/privatechat')
						}}
						data-seed="logId1"
					>
					</TabBar.Item>

					<TabBar.Item
						icon={
							<i className='iconfont icon-me'></i>
						}
						selectedIcon={
							<i className='iconfont icon-04f'></i>
						}
						title="我的"
						key="me"
						selected={pathname === '/busme'}
						onPress={() => {
							this.props.history.push('/busme')
						}}
						data-seed='logId1'
					>
					</TabBar.Item>
				</TabBar>
			</div>
		);
	}
}
export default withRouter(MyTab);